The process of serialization is the converting of an object or a connected graph of objects, stored within computer memory, and conventionally drawn on paper in two dimensions, into a linear encoded sequence of bytes. The basic idea of serialization is that an object should be able to write its current state, usually indicated by the value of its member variables, to persistent storage. The linear encoded bytes contain all of the information that was contained in the starting objects. That sequence of bytes may be used in several ways. For example, the sequence may be sent to another process on the same machine to construct arguments to a method that is run in another process. The sequence may be sent to the clipboard to be browsed or included in another application, sent “down the wire” to another machine to create a clone on that machine of the original object graph, or sent to a file on-disk so that it can be reused later.
The Microsoft .NET Framework accomplishes serialization by reflecting upon the object graph to generate a linear encoding (e.g., such as XML or .NET Binary Format). Reflection allows the dynamic discovery of fields and properties for a given Common Language Runtime (CLR) type. Using reflection it is possible to retrieve the values of fields and properties from an object instance. Furthermore, reflection enables the developer to discern a type's inheritance hierarchy.
Deserialization is the process of taking the linear encoded representation of an object graph and re-hydrating the representation into an in-memory representation. The linear encoding contains a type description for each object in the graph. This type description is read and correlated with a CLR type. This CLR type is then instantiated and the data members are populated through reflection. By combining deserialization and serialization it is possible to transmit in-memory objects between endpoints in a distributed system.
Strongly-typed models are those where each type of data (e.g., integer, character, hexadecimal, packed decimal, user-defined types, etc.) is predefined within a type system that can be checked at compile-time by the compiler of a programming language (i.e., C/C++, C#, etc.) and all constants or variables defined for a given program must be described with one of the data types. A problem that often occurs within strongly typed models is that not all types are present on all nodes in the network. This problem could result because either the type is completely unknown or has been extended in a future version which is not available when deserializing the graph.
Thus, in view of the foregoing, there is a need for systems and methods that overcome the limitations and drawbacks of the prior art. In particular, there is a need to handle unknown types in a strongly typed distributed programming model. Further, there is a need for versioning and extensibility mechanisms in distributed models to allow different versions of systems to interoperate. The present invention provides such a solution.